import React, { Component } from 'react'
import events from '@/utils/EventBus'
export default class C extends Component {
  constructor(){
    super()
    this.state={
      msg:''
    }
  }

  componentDidMount(){
    events.addListener('send',(arg)=>{
      console.log('arg',arg);
      this.setState({msg:arg})
    })
  }
  render() {
    const {msg}=this.state
    return (
      <div style={{width:'200px',height:'200px',backgroundColor:'skyblue'}}>{msg}</div>
    )
  }
}
